<template>
  <div class="kawaii-upload-detail">
    <!-- 背景装饰 -->
    <div class="animated-background">
      <div class="magic-circle" :class="{ active: showMagicCircle }"></div>
      <div class="floating-hearts">
        <div class="heart" v-for="n in 20" :key="n"></div>
      </div>
    </div>

    <!-- 魔卡少女樱封印解除动画 -->
    <div v-if="showSealReleaseAnimation" class="seal-release-overlay">
      <div ref="lottieContainer" class="lottie-container"></div>
    </div>

    <!-- 页面标题 -->
    <div class="kawaii-header">
      <h1 class="cute-title">✨ 魔法投稿 ✨</h1>
    </div>

    <!-- 主内容区 -->
    <div class="kawaii-main">
      <!-- 投稿信息卡片 -->
      <div class="upload-info-card">
        <div class="file-info">
          <div class="file-icon">📁</div>
          <div class="file-details">
            <div class="file-name">{{ fileName }}</div>
            <div class="file-size">{{ formatFileSize(fileSize) }}</div>
          </div>
        </div>

        <!-- 投稿进度条 -->
        <div class="upload-progress" v-if="showForm">
          <div class="progress-label">
            <span>封印解除进度</span>
            <span class="progress-percent">{{ uploadProgress }}%</span>
          </div>

          <!-- 魔卡少女樱风格进度条 -->
          <div class="sakura-progress-container">
            <div
              class="sakura-progress-bar"
              :style="{ width: uploadProgress + '%' }"
              :class="{ 'seal-released': uploadProgress >= 100 }"
            ></div>

            <!-- 小樱法杖指示器 -->
            <div
              class="sakura-wand"
              :style="{ left: uploadProgress + '%' }"
              :class="{ 'seal-complete': uploadProgress >= 100 }"
            ></div>
          </div>
        </div>

        <!-- 表单内容 -->
        <div class="form-section" v-if="showForm">
          <div class="form-title">填写视频信息</div>

          <!--          <div class="form-group">-->
          <!--            <label>-->
          <!--              视频分片-->
          <!--              <span class="kawaii-tag">可添加多个视频哦~</span>-->
          <!--            </label>-->
          <!--            <div class="parts-container">-->
          <!--              <div class="parts-list">-->
          <!--                <div-->
          <!--                  v-for="(part, index) in videoParts"-->
          <!--                  :key="index"-->
          <!--                  class="part-item"-->
          <!--                >-->
          <!--                  <div class="part-info">-->
          <!--                    <div class="part-icon">🎬</div>-->
          <!--                    <div class="part-details">-->
          <!--                      <div class="part-name">-->
          <!--                        P{{ index + 1 }}: {{ part.name }}-->
          <!--                      </div>-->
          <!--                      <div class="part-size">-->
          <!--                        {{ formatFileSize(part.size) }}-->
          <!--                      </div>-->
          <!--                    </div>-->
          <!--                  </div>-->
          <!--                  <div class="part-actions">-->
          <!--                    <div v-if="part.uploading" class="part-progress">-->
          <!--                      <div-->
          <!--                        class="part-progress-bar"-->
          <!--                        :style="{ width: part.progress + '%' }"-->
          <!--                      ></div>-->
          <!--                      <span class="part-progress-text">-->
          <!--                        {{ part.progress }}%-->
          <!--                      </span>-->
          <!--                    </div>-->
          <!--                    <button-->
          <!--                      v-else-->
          <!--                      class="part-delete"-->
          <!--                      @click="removePart(index)"-->
          <!--                    >-->
          <!--                      <span>❌</span>-->
          <!--                    </button>-->
          <!--                  </div>-->
          <!--                </div>-->

          <!--                &lt;!&ndash; 主视频显示为P1 &ndash;&gt;-->
          <!--                <div-->
          <!--                  v-if="videoParts.length === 0 && fileName"-->
          <!--                  class="part-item main-part"-->
          <!--                >-->
          <!--                  <div class="part-info">-->
          <!--                    <div class="part-icon">📹</div>-->
          <!--                    <div class="part-details">-->
          <!--                      <div class="part-name">P1: {{ fileName }}</div>-->
          <!--                      <div class="part-size">-->
          <!--                        {{ formatFileSize(fileSize) }}-->
          <!--                      </div>-->
          <!--                    </div>-->
          <!--                  </div>-->
          <!--                  <div class="part-status">已上传完成</div>-->
          <!--                </div>-->
          <!--              </div>-->

          <!--              <button-->
          <!--                v-if="videoParts.length < 5"-->
          <!--                class="add-part-btn"-->
          <!--                @click="addNewPart"-->
          <!--              >-->
          <!--                <span class="add-icon">❤️</span>-->
          <!--                <span>添加分P</span>-->
          <!--                <input-->
          <!--                  ref="partInput"-->
          <!--                  type="file"-->
          <!--                  accept="video/*"-->
          <!--                  style="display: none"-->
          <!--                  @change="handlePartSelect"-->
          <!--                />-->
          <!--              </button>-->
          <!--              <div v-else class="part-limit">最多只能添加5个分P哦~</div>-->
          <!--            </div>-->
          <!--          </div>-->

          <div class="form-group">
            <label>视频标题</label>
            <input
              type="text"
              v-model="videoData.title"
              placeholder="给你的创作取个可爱的名字吧~"
            />
          </div>

          <div class="form-group">
            <label>视频封面</label>
            <div class="cover-upload">
              <div class="cover-preview" v-if="coverPreview">
                <img :src="coverPreview" alt="封面预览" />
              </div>
              <div class="cover-placeholder" v-else>
                <span>点击选择封面图片</span>
              </div>
              <input
                type="file"
                accept="image/*"
                @change="handleCoverChange"
                style="display: none"
                ref="coverInput"
              />
              <button @click="selectCover" class="cover-btn">选择封面</button>
            </div>
          </div>

          <div class="form-group">
            <label>视频分区</label>
            <select v-model="videoData.category">
              <option value="">请选择分区</option>
              <option value="anime">动画</option>
              <option value="manga">漫画</option>
              <option value="game">游戏</option>
              <option value="music">音乐</option>
              <option value="dance">舞蹈</option>
              <option value="tech">科技</option>
            </select>
          </div>

          <div class="form-group">
            <label>视频标签</label>
            <div class="tags-container">
              <div
                class="tag"
                v-for="(tag, index) in videoData.tags"
                :key="index"
              >
                {{ tag }}
                <span class="remove-tag" @click="removeTag(index)">×</span>
              </div>
              <input
                type="text"
                v-model="tagInput"
                @keyup.enter="addTag"
                placeholder="输入标签后按Enter"
                class="tag-input"
              />
            </div>
          </div>

          <div class="form-group">
            <label>视频简介</label>
            <textarea
              v-model="videoData.description"
              placeholder="写点什么来介绍你的视频吧~"
              rows="4"
            ></textarea>
          </div>

          <div class="form-actions">
            <button class="submit-btn" @click="submitVideo">提交发布</button>
            <button class="cancel-btn" @click="cancelUpload">取消</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import lottie from 'lottie-web'

const route = useRoute()
const router = useRouter()

// 获取路由参数
const fileName = ref((route.query.filename as string) || '未命名文件')
const fileSize = ref(Number(route.query.filesize) || 0)

// 视频数据
const videoData = ref({
  title: '',
  category: '',
  tags: [] as string[],
  description: '',
})

// 视频分P数据
interface VideoPart {
  name: string
  size: number
  uploading: boolean
  progress: number
}

const videoParts = ref<VideoPart[]>([])
const partInput = ref<HTMLInputElement | null>(null)

// 添加新分P
const addNewPart = () => {
  if (partInput.value) {
    partInput.value.click()
  }
}

// 处理分P选择
const handlePartSelect = (event: Event) => {
  const input = event.target as HTMLInputElement
  if (input.files && input.files[0]) {
    const file = input.files[0]

    // 添加到分P列表
    videoParts.value.push({
      name: file.name,
      size: file.size,
      uploading: true,
      progress: 0,
    })

    // 模拟上传进度
    const partIndex = videoParts.value.length - 1
    simulatePartUpload(partIndex)

    // 清空input以便再次选择同一文件
    input.value = ''
  }
}

// 模拟分P上传
const simulatePartUpload = (partIndex: number) => {
  const interval = setInterval(() => {
    if (videoParts.value[partIndex]) {
      videoParts.value[partIndex].progress += 2

      if (videoParts.value[partIndex].progress >= 100) {
        clearInterval(interval)
        videoParts.value[partIndex].uploading = false
      }
    } else {
      clearInterval(interval)
    }
  }, 100)
}

// 移除分P
const removePart = (index: number) => {
  videoParts.value.splice(index, 1)
}

// 表单相关
const showForm = ref(true)
const tagInput = ref('')
const coverPreview = ref('')
const coverInput = ref<HTMLInputElement | null>(null)

// 动画相关
const uploadProgress = ref(0)
const showMagicCircle = ref(false)
const currentDivergence = ref('0.571024')
const divergenceValues = [
  '0.571024',
  '0.523299',
  '0.337187',
  '0.275349',
  '0.456914',
  '0.571046',
  '1.048596',
]

// Lottie动画相关
const lottieContainer = ref<HTMLDivElement | null>(null)
let sealAnimation: any = null
const showSealReleaseAnimation = ref(false)

// 格式化文件大小
const formatFileSize = (size: number): string => {
  if (size < 1024) {
    return size + ' B'
  } else if (size < 1024 * 1024) {
    return (size / 1024).toFixed(2) + ' KB'
  } else if (size < 1024 * 1024 * 1024) {
    return (size / (1024 * 1024)).toFixed(2) + ' MB'
  } else {
    return (size / (1024 * 1024 * 1024)).toFixed(2) + ' GB'
  }
}

// 添加标签
const addTag = () => {
  if (
    tagInput.value &&
    !videoData.value.tags.includes(tagInput.value) &&
    videoData.value.tags.length < 10
  ) {
    videoData.value.tags.push(tagInput.value)
    tagInput.value = ''
  }
}

// 移除标签
const removeTag = (index: number) => {
  videoData.value.tags.splice(index, 1)
}

// 选择封面
const selectCover = () => {
  if (coverInput.value) {
    coverInput.value.click()
  }
}

// 处理封面选择
const handleCoverChange = (event: Event) => {
  const input = event.target as HTMLInputElement
  if (input.files && input.files[0]) {
    const file = input.files[0]
    const reader = new FileReader()
    reader.onload = (e) => {
      if (e.target) {
        coverPreview.value = e.target.result as string
      }
    }
    reader.readAsDataURL(file)
  }
}

// 播放封印解除动画
const playSealReleaseAnimation = () => {
  showSealReleaseAnimation.value = true

  if (lottieContainer.value) {
    sealAnimation = lottie.loadAnimation({
      container: lottieContainer.value,
      renderer: 'svg',
      loop: false,
      autoplay: true,
      path: '/src/assets/animations/sakura-seal-release.json',
    })

    sealAnimation.addEventListener('complete', () => {
      showSealReleaseAnimation.value = false
      showForm.value = true
    })
  }
}

// 模拟上传过程
const simulateUpload = () => {
  showMagicCircle.value = true

  const interval = setInterval(() => {
    uploadProgress.value += 1

    if (uploadProgress.value >= 100) {
      clearInterval(interval)
      setTimeout(() => {
        playSealReleaseAnimation()
      }, 500)
    }
  }, 100)
}

// 取消上传
const cancelUpload = () => {
  router.push('/front/create')
}

// 提交视频
const submitVideo = () => {
  // 在实际应用中应该将数据提交到服务器
  alert('视频上传成功！')
  router.push('/front/create')
}

// 组件挂载时调用
onMounted(() => {
  // 页面加载时开始模拟上传
  simulateUpload()
})

// 组件卸载时清理资源
onUnmounted(() => {
  if (sealAnimation) {
    sealAnimation.destroy()
    sealAnimation = null
  }
})
</script>

<style lang="scss" scoped>
.kawaii-upload-detail {
  width: 100%;
  min-height: 100vh;
  position: relative;
  padding: 20px;
  overflow: hidden;

  // 背景效果
  .animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #ffe6eb 0%, #ffccd5 50%, #fff0f5 100%);
    overflow: hidden;

    // 魔法阵
    .magic-circle {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 500px;
      height: 500px;
      border-radius: 50%;
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" fill="none" stroke="%23ff6b8b" stroke-width="0.5"/><circle cx="50" cy="50" r="35" fill="none" stroke="%23ff6b8b" stroke-width="0.3"/><polygon points="50,5 55,20 70,20 60,30 65,45 50,35 35,45 40,30 30,20 45,20" fill="none" stroke="%23ff6b8b" stroke-width="0.3"/><polygon points="50,5 45,20 30,20 40,30 35,45 50,35 65,45 60,30 70,20 55,20" fill="none" stroke="%23ff6b8b" stroke-width="0.3"/></svg>');
      background-repeat: no-repeat;
      background-position: center;
      background-size: contain;
      opacity: 0;
      transition: all 0.5s ease;

      &.active {
        opacity: 0.15;
        animation: rotate 30s linear infinite;
      }
    }

    // 浮动心形
    .floating-hearts {
      position: absolute;
      width: 100%;
      height: 100%;

      .heart {
        position: absolute;
        width: 15px;
        height: 15px;
        background-color: transparent;
        opacity: 0.7;
        animation: float 10s infinite ease-in-out;

        &::before,
        &::after {
          content: '';
          position: absolute;
          width: 10px;
          height: 16px;
          border-radius: 50% 50% 0 0;
          background: rgba(255, 107, 129, 0.5);
        }

        &::before {
          left: 0;
          transform: rotate(-45deg);
          transform-origin: 100% 100%;
        }

        &::after {
          left: 5px;
          transform: rotate(45deg);
          transform-origin: 0 100%;
        }

        @for $i from 1 through 20 {
          &:nth-child(#{$i}) {
            top: percentage(random(100) / 100);
            left: percentage(random(100) / 100);
            transform: scale(0.6 + random(6) / 10);
            animation-delay: random(300) / 100 + s;
            animation-duration: 10 + random(20) + s;
          }
        }
      }
    }
  }

  // 标题样式
  .kawaii-header {
    text-align: center;
    margin-bottom: 30px;

    .cute-title {
      font-size: 32px;
      font-weight: 700;
      color: #ff3366;
      text-shadow: 0 2px 10px rgba(255, 51, 102, 0.3);
      animation: pulse 2s infinite alternate;
      position: relative;
      display: inline-block;

      &::before,
      &::after {
        content: '✨';
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        animation: float 3s ease-in-out infinite;
      }

      &::before {
        left: -40px;
        animation-delay: 0.5s;
      }

      &::after {
        right: -40px;
        animation-delay: 1s;
      }
    }
  }

  // 添加视频分P功能的样式
  .kawaii-tag {
    font-size: 12px;
    background-color: #ffccd5;
    color: #ff3366;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
  }

  .parts-container {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 2px solid rgba(255, 51, 102, 0.3);
    padding: 15px;
    margin-bottom: 15px;

    .parts-list {
      margin-bottom: 15px;
    }

    .part-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-color: rgba(255, 255, 255, 0.8);
      border-radius: 10px;
      padding: 10px 15px;
      margin-bottom: 10px;
      box-shadow: 0 2px 5px rgba(255, 51, 102, 0.1);
      transition: all 0.3s ease;

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(255, 51, 102, 0.2);
      }

      &.main-part {
        border: 2px dashed rgba(255, 51, 102, 0.5);
      }

      .part-info {
        display: flex;
        align-items: center;

        .part-icon {
          font-size: 24px;
          margin-right: 12px;
          animation: bounce 2s infinite alternate;
        }

        .part-details {
          .part-name {
            font-size: 14px;
            font-weight: 600;
            color: #ff3366;
            margin-bottom: 3px;
          }

          .part-size {
            font-size: 12px;
            color: #f06292;
          }
        }
      }

      .part-actions {
        display: flex;
        align-items: center;

        .part-progress {
          width: 100px;
          height: 16px;
          background-color: rgba(255, 51, 102, 0.1);
          border-radius: 8px;
          position: relative;
          overflow: hidden;

          .part-progress-bar {
            height: 100%;
            background: linear-gradient(to right, #ff9e80, #ff80ab);
            border-radius: 8px;
          }

          .part-progress-text {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: 600;
            color: #fff;
          }
        }

        .part-delete {
          background: none;
          border: none;
          cursor: pointer;
          font-size: 18px;
          color: #ff3366;
          opacity: 0.7;
          transition: all 0.3s;

          &:hover {
            opacity: 1;
            transform: scale(1.2);
          }
        }
      }

      .part-status {
        font-size: 12px;
        color: #4caf50;
        font-weight: 600;
      }
    }

    .add-part-btn {
      width: 100%;
      padding: 12px;
      border: 2px dashed rgba(255, 51, 102, 0.5);
      background-color: rgba(255, 51, 102, 0.05);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s;
      color: #ff3366;
      font-weight: 600;

      &:hover {
        background-color: rgba(255, 51, 102, 0.1);
        transform: translateY(-2px);
      }

      .add-icon {
        margin-right: 8px;
        font-size: 18px;
        animation: pulsate 1.5s infinite;
      }
    }

    .part-limit {
      text-align: center;
      color: #ff3366;
      font-size: 14px;
      padding: 10px;
    }
  }

  // 主内容
  .kawaii-main {
    display: flex;
    justify-content: center;

    // 上传信息卡片
    .upload-info-card {
      width: 100%;
      max-width: 800px;
      background-color: rgba(255, 255, 255, 0.9);
      border-radius: 20px;
      padding: 30px;
      box-shadow: 0 10px 30px rgba(156, 39, 176, 0.15);
      position: relative;
      overflow: hidden;

      // 文件信息
      .file-info {
        display: flex;
        align-items: center;
        margin-bottom: 30px;

        .file-icon {
          font-size: 48px;
          margin-right: 20px;
          animation: bounce 2s infinite alternate;
        }

        .file-details {
          .file-name {
            font-size: 22px;
            font-weight: 600;
            color: #6a1b9a;
            margin-bottom: 5px;
          }

          .file-size {
            font-size: 16px;
            color: #9e9e9e;
          }
        }
      }

      // 上传进度
      .upload-progress {
        margin-bottom: 30px;

        .progress-label {
          display: flex;
          justify-content: space-between;
          margin-bottom: 10px;
          font-weight: 500;
          color: #6a1b9a;

          .progress-percent {
            color: #d500f9;
          }
        }

        // 魔卡少女樱风格进度条
        .sakura-progress-container {
          height: 20px;
          background-color: rgba(233, 30, 99, 0.1);
          border-radius: 10px;
          position: relative;
          margin-bottom: 15px;
          overflow: hidden;

          .sakura-progress-bar {
            height: 100%;
            background: linear-gradient(to right, #ff80ab, #ff4081);
            border-radius: 10px;
            position: relative;
            transition: width 0.3s ease;

            &::before {
              content: '';
              position: absolute;
              top: 0;
              left: 0;
              width: 100%;
              height: 100%;
              background: linear-gradient(
                90deg,
                rgba(255, 255, 255, 0) 0%,
                rgba(255, 255, 255, 0.5) 50%,
                rgba(255, 255, 255, 0) 100%
              );
              animation: shine 1.5s infinite;
            }

            &.seal-released {
              animation: glow 1s infinite alternate;
            }
          }

          // 小樱法杖进度指示器
          .sakura-wand {
            position: absolute;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 20px;
            height: 20px;
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23ff4081" d="M12,2L4.5,20.29L5.21,21L18.79,21L19.5,20.29L12,2Z"/></svg>');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            filter: drop-shadow(0 0 3px rgba(255, 64, 129, 0.7));

            &.seal-complete {
              animation: pulse 0.5s infinite alternate;
            }
          }
        }
      }

      // 表单部分
      .form-section {
        opacity: 0;
        animation: fadeIn 0.5s forwards;

        .form-title {
          font-size: 24px;
          font-weight: 600;
          color: #6a1b9a;
          margin-bottom: 20px;
          text-align: center;
        }

        .form-group {
          margin-bottom: 20px;

          label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #6a1b9a;
          }

          input[type='text'],
          select,
          textarea {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid rgba(156, 39, 176, 0.3);
            border-radius: 10px;
            font-size: 16px;
            color: #333;
            background-color: rgba(255, 255, 255, 0.7);
            transition: all 0.3s;

            &:focus {
              outline: none;
              border-color: #9c27b0;
              box-shadow: 0 0 0 2px rgba(156, 39, 176, 0.2);
            }
          }

          // 封面上传
          .cover-upload {
            display: flex;
            flex-direction: column;
            align-items: center;

            .cover-preview,
            .cover-placeholder {
              width: 240px;
              height: 135px;
              border-radius: 8px;
              margin-bottom: 10px;
              overflow: hidden;
              border: 2px dashed rgba(156, 39, 176, 0.3);
              display: flex;
              align-items: center;
              justify-content: center;

              img {
                width: 100%;
                height: 100%;
                object-fit: cover;
              }

              span {
                color: #9e9e9e;
                font-size: 14px;
              }
            }

            .cover-btn {
              padding: 8px 15px;
              background: linear-gradient(45deg, #ff9e80, #ff80ab);
              color: white;
              border: none;
              border-radius: 20px;
              font-size: 14px;
              cursor: pointer;
              transition: all 0.3s;
              box-shadow: 0 3px 5px rgba(255, 128, 171, 0.3);

              &:hover {
                transform: translateY(-2px);
                box-shadow: 0 5px 10px rgba(255, 128, 171, 0.4);
              }
            }
          }

          // 标签容器
          .tags-container {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            padding: 10px;
            border: 2px solid rgba(156, 39, 176, 0.3);
            border-radius: 10px;
            background-color: rgba(255, 255, 255, 0.7);
            min-height: 45px;

            .tag {
              display: flex;
              align-items: center;
              padding: 5px 10px;
              background: linear-gradient(45deg, #ff80ab, #9575cd);
              color: white;
              border-radius: 15px;
              font-size: 14px;

              .remove-tag {
                margin-left: 5px;
                cursor: pointer;
                font-weight: bold;

                &:hover {
                  color: #fce4ec;
                }
              }
            }

            .tag-input {
              flex: 1;
              min-width: 100px;
              padding: 5px;
              border: none;
              background: transparent;
              font-size: 14px;

              &:focus {
                outline: none;
              }
            }
          }
        }

        // 表单操作按钮
        .form-actions {
          display: flex;
          justify-content: center;
          gap: 15px;
          margin-top: 30px;

          button {
            padding: 12px 30px;
            border: none;
            border-radius: 25px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s;

            &.submit-btn {
              background: linear-gradient(45deg, #ff9e80, #ff80ab);
              color: white;
              box-shadow: 0 4px 10px rgba(255, 128, 171, 0.4);

              &:hover {
                transform: translateY(-3px);
                box-shadow: 0 6px 15px rgba(255, 128, 171, 0.5);
              }
            }

            &.cancel-btn {
              background-color: rgba(0, 0, 0, 0.05);
              color: #757575;

              &:hover {
                background-color: rgba(0, 0, 0, 0.1);
                transform: translateY(-2px);
              }
            }
          }
        }
      }
    }
  }
}

// 动画关键帧
@keyframes rotate {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

  50% {
    transform: translateY(-50%) translateX(5px);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.8;
    text-shadow: 0 0 5px rgba(156, 39, 176, 0.5);
  }

  100% {
    opacity: 1;
    text-shadow: 0 0 15px rgba(213, 0, 249, 0.8);
  }
}

@keyframes shine {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@keyframes scan {
  0% {
    transform: translateY(-100%);
  }

  100% {
    transform: translateY(100%);
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(255, 64, 129, 0.5);
  }

  100% {
    box-shadow: 0 0 15px rgba(255, 64, 129, 0.8);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulsate {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}
</style>
